/* --- 1. Variables & Root --- */
:root {
    --primary: #011d5d;      /* iVista Deep Navy */
    --accent: #e67e22;       /* Action Orange */
    --bg: #f4f7f6;           /* Soft Light Gray */
    --card-bg: #ffffff;
    --text: #333333;
    --text-muted: #7f8c8d;
    --link: #2980b9;
    --border: #dddddd;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- 2. Global Reset --- */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 0; 
    line-height: 1.6; 
}

/* --- 3. Layout Components --- */
header { 
    background: var(--primary); 
    color: #ffffff; 
    padding: 30px 20px; 
    text-align: center; 
    border-bottom: 5px solid var(--accent); 
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

/* Main Content Container */
.container { 
    max-width: 1200px; 
    margin: 20px auto; 
    padding: 20px; 
    display: grid;
    /* Injected via PHP: --grid-cols */
    grid-template-columns: repeat(var(--grid-cols, 3), 1fr) !important;
    gap: 20px;
    align-items: start;
}

footer { 
    text-align: center; 
    padding: 40px; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    border-top: 1px solid var(--border); 
    margin-top: 40px; 
}

/* --- 4. Cards & Content --- */
.card { 
    background: var(--card-bg); 
    padding: 25px; 
    border-radius: 10px; 
    box-shadow: var(--shadow); 
    transition: transform 0.2s ease; 
}

.card:hover { 
    transform: translateY(-5px); 
}

.card h3 { 
    color: var(--primary); 
    font-size: 1.25rem; 
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 10px; 
    margin: 0 0 15px 0; 
}

/* Link List Styling */
.link-item { 
    margin-bottom: 12px; 
    padding-bottom: 8px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-item:last-child {
    border-bottom: none;
}

/* Typography */
a { 
    color: var(--link); 
    text-decoration: none; 
    font-weight: 500; 
}

a:hover { 
    color: var(--accent); 
    text-decoration: underline; 
}

p {
    margin: 0 0 10px 0;
}

/* --- 5. Responsive Breakpoints --- */
@media (max-width: 1200px) {
    .container { 
        grid-template-columns: repeat(min(var(--grid-cols, 3), 3), 1fr) !important; 
    }
}

@media (max-width: 900px) {
    .container { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 600px) {
    .container { 
        grid-template-columns: 1fr !important; 
        padding: 10px;
    }
    
    header {
        padding: 20px 10px;
    }

    header h1 {
        font-size: 1.3rem;
    }
}

/* This ensures that on small screens, it drops to 1 column 
   even if the .ini says 6 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr !important;
    }
}